package com.nzy.common;

import java.io.Serializable;

public class ResultData implements Serializable {

    private Integer code;

    private String msg;

    private Object data;

    public static ResultData success(){
        ResultData data = new ResultData();
        data.setCode(200);
        data.setMsg("");
        return data;
    }

    public static ResultData success(Object data){
        ResultData resultData = new ResultData();
        resultData.setCode(200);
        resultData.setMsg("");
        resultData.setDate(data);
        return resultData;
    }

    public static ResultData fail(String msg){
        ResultData data = new ResultData();
        data.setCode(500);
        data.setMsg(msg);
        return data;
    }



    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Object getData() {
        return data;
    }

    public void setDate(Object data) {
        this.data = data;
    }
}
